/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2025-08-07 16:22:57
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2025-09-01 16:34:50
 * @FilePath: \project\work-tool\experi-api\routes\plateform\login.js
 * @Description: 
 */
const express = require('express');
const router = express.Router();
const plateformModel = require('../../models/plateformLogin')

router.post('/api/plateform/login', function(req, res, next) {
  const params = req.body
  if (plateformModel.find(params)) {
    return res.send({
      code: 400,
      data: {
        message: '用户已存在',
        time: new Date().getTime(),
        token: '123456'
      },
      message: 'failed'
    })
  } else {
    plateformModel.create(params)
  }
  return res.send({
    code: 200,
    data: {
      message: '注册成功',
      time: new Date().getTime(),
      token: '123456'
    },
    message: 'success'
  })
});


module.exports = router;